<?
@extract($_GET);
@extract($_POST);
include "../../../config.php";
include "../../../dbconfig.php";
$music_path = "../../../data/file/$bo_table/";
$connect = @mysql_connect($mysql_host, $mysql_user, $mysql_password);
$select_db = @mysql_select_db($mysql_db, $connect);
?>

<html>
<head>
<title>NTYPE 플레이어</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script language=Javascript src="./set.js"></script>
<script language=Javascript>
	var songPlaying;
	var songPlaying2=0;
	var songtime;
	var chktime;
	var stopmode = 0;
	var person = null;
	var subj = null;
	var frktle = null;
	var frkric=null;
	var smi = null;
	var Spec = 1;
	var track = 0;
	var count = 0;
	var stopTitle=1;
	var Looping = false;
	var dragapproved=false;
	browserName = navigator.appName;
	browserVer = parseInt(navigator.appVersion);
	if(browserName == "Netscape" && browserVer >= 3){ init = "net"; }
	else { init = "ie"; }
	if(((init == "net")&&(browserVer >=3))||((init == "ie")&&(browserVer >= 4))){
		mutemode_on=new Image;
		mutemode_off=new Image;
		mutemode_on.src="./images/Mute_on.gif";
		mutemode_off.src="./images/Mute_off.gif";
		loop_on=new Image;
		loop_off=new Image;
		loop_on.src="./images/Loop_on.gif";
		loop_off.src="./images/Loop_off.gif";
		Pause_on=new Image;
		Pause_off=new Image;
		Pause_on.src="./images/Pause_on.gif";
		Pause_off.src="./images/Pause_off.gif";
		randommode_on=new Image;
		randommode_off=new Image;
		randommode_on.src="./images/random_on.gif";
		randommode_off.src="./images/random_off.gif";
		allloop_on=new Image;
		allloop_off=new Image;
		allloop_on.src="./images/allloop_on.gif";
		allloop_off.src="./images/allloop_off.gif";
		stop_on=new Image;
		stop_off=new Image;
		stop_on.src="./images/Stop_on.gif";
		stop_off.src="./images/Stop_off.gif";
		play_on=new Image;
		play_off=new Image;
		play_on.src="./images/Play_on.gif";
		play_off.src="./images/Play_off.gif";
		spectrum_on=new Image;
		spectrum_off=new Image;
		spectrum_on.src="./images/spectrum_on.gif";
		spectrum_off.src="./images/spectrum_off.gif";
		spec_on=new Image;
		spec_off=new Image;
		spec_on.src="./images/spec_on.gif";
		spec_off.src="./images/spec_off.gif";
		plist_on=new Image;
		plist_off=new Image;
		plist_on.src="./images/List_on.gif";
		plist_off.src="./images/List_off.gif";

	}

	function setting() {
		document.all.item('volcontrol').style.left =volposition;
		document.all.item('volcontrol').style.top = voltopposition;
		document.all.item('balcontrol').style.left =balcenposition+ballength;
		document.all.item('balcontrol').style.top = baltopposition;
		document.frkmx.Controls.Stop(); //미디어 정지상태로 설정
		document.all.item('trackPosition').style.left = trackbarposition;
		document.all.item('trackPosition').style.top = trackbartopposition;
		if (autoplay == 1) {
		if (playmode == 1) {
		track = Math.floor(Math.random() * person.length);
		ImgSrc=eval("randommode_on.src");
		document.randommode.src=ImgSrc;
		document.randommode.alt="순차재생하기";
		ImgSrc=eval("Pause_off.src");
		document.Pause.src=ImgSrc;
		document.Pause.alt="일시중지";
		ImgSrc=eval("play_on.src");
		document.play.src=ImgSrc;
		document.play.alt="♪♬";
		ImgSrc=eval("stop_off.src");
		document.stop.src=ImgSrc;
		document.stop.alt="중 지";
		ImgSrc=eval("spectrum_on.src");
		document.spectrum.src=ImgSrc;
		ImgSrc=eval("spec_on.src");
		document.spec.src=ImgSrc;
		}
		else {
		ImgSrc=eval("randommode_off.src");
		document.randommode.src=ImgSrc;
		document.randommode.alt="랜덤재생하기";
		track = 0;}
		stopmode = 0;
		change(track);
		 }
		else { BGM_Stop(); }
		switch(MuteMode) {
		case 0 :
		document.BGM.mutemode.style.visibility = "hidden";
		document.BGM.mutemode.style. width = 0;
		document.BGM.mutemode.style. height = 0;
		break;
		case 1 :
		break;
		}
		switch(RanDom) {
		case 0 :
		document.BGM.randommode.style.visibility = "hidden";
		document.BGM.randommode.style. width = 0;
		document.BGM.randommode.style. height = 0;
		break;
		case 1 :
		break;
		}
		switch(AllLoopMode) {
		case 0 :
		document.BGM.allloop.style.visibility = "hidden";
		document.BGM.allloop.style. width = 0;
		document.BGM.allloop.style. height = 0;
		break;
		case 1 :
		break;
		}
		switch(LoopMode) {
		case 0 :
		document.BGM.loop.style.visibility = "hidden";
		document.BGM.loop.style.width = 0;
		document.BGM.loop.style.height = 0;
		break;
		case 1 :
		break;
		}
		switch(Spectrum) {
		case 0 :
		document.BGM.spectrum.style.visibility = "hidden";
		document.BGM.spectrum.style.width = 0;
		document.BGM.spectrum.style.height = 0;
		break;
		case 1 :
		break;
		}
		switch(Spec) {
		case 0 :
		document.BGM.spec.style.visibility = "hidden";
		document.BGM.spec.style.width = 0;
		document.BGM.spec.style.height = 0;
		break;
		case 1 :
		break;
		}
		switch(PlayList) {
		case 0 :
		document.BGM.plist.style.visibility = "hidden";
		document.BGM.plist.style.width = 0;
		document.BGM.plist.style.height = 0;
		break;
		case 1 :
		break;
		case 2 :
		break;
		}
		}
	if(PlayList==2){
	parent.resizeTo(bgmlistminw,bgmlistminh);
	}

	function Balanceout() {
		songPlaying = document.frkmx.PlayState;
		if (songPlaying == 0){updateTitle();return true;}
		else{updateTitle(1);return true;}
		}

	var isOpenWindow=false;
	function setWindowSize2() {
			if (!isOpenWindow) {
					parent.resizeTo(bgmlistmaxw,bgmlistmaxh);
					isOpenWindow=true;
		ImgSrc=eval("plist_on.src");
		document.plist.src=ImgSrc;
		document.plist.alt="목록 숨기기";
			} else {
					parent.resizeTo(bgmlistminw,bgmlistminh);
					isOpenWindow=false;
		ImgSrc=eval("plist_off.src");
		document.plist.src=ImgSrc;
		document.plist.alt="목록보기";
			}
	}

	function setWindowSize(wi,he) {
	var intwidth;
	var intheight;
	intwidth=wi;
	intheight=he;
	intwidth=parseInt(intwidth);
	intheight=parseInt(intheight);
	if(intwidth>0&&intheight>0) {parent.resizeTo(intwidth,intheight);}
	else{return;}
	}

	function Fullscreen()
	{
		document.frkmx.fullscreen=true;
	}

	function initbalance() {
		iex=event.clientX;
		iey=event.clientY;
		tempx=balcontrol.style.pixelLeft;
		tempy=balcontrol.style.pixelTop;
		dragapproved=true;
		document.onmousemove=baldrag_dropie;
		if (document.all)	{
			document.onmouseup=new Function('dragapproved=false');
		}
	}

	function baldrag_dropie() {
		bal_length=ballength;
		bal_startpoint=balcenposition;
		if (dragapproved==true) {
			var mov = tempx+event.clientX-iex-bal_length;
			if (mov <= bal_startpoint+bal_length  && mov > bal_startpoint-bal_length)
			{
				document.all.balcontrol.style.pixelLeft=tempx+event.clientX-iex;
				per=((mov-bal_startpoint)/bal_length);
				balance=per*100;
				document.frkmx.settings.balance = balance;  //new balance
				if((playTitle == 1) || (playTitle == 2)){
				balance=parseInt(balance,10);
				if(balance<0){balance=-balance;
				stitle.innerHTML = " Balance : "+balance+"% Left";
				return true;}
				else if(balance>0){
				stitle.innerHTML = " Balance : "+balance+"% Right";}
				else {stitle.innerHTML = " Balance : Center";}
				}
			}
			return false;
		}
	}

	function initializedragie() {
		iex=event.clientX;
		iey=event.clientY;
		tempx=volcontrol.style.pixelLeft;
		tempy=volcontrol.style.pixelTop;
		dragapproved=true;
		document.onmousemove=drag_dropie;
		if (document.all)	{
			document.onmouseup=new Function('dragapproved=false');
		}
	}
	function drag_dropie() {
		vol_length=vollength;
		vol_startpoint=volminposition;
		if (dragapproved==true) {
			var mov = tempx+event.clientX-iex-vol_length;
			if (mov <= vol_startpoint  && mov > vol_startpoint-vol_length)	{
				document.all.volcontrol.style.pixelLeft=tempx+event.clientX-iex;
				per=((mov-vol_startpoint)/vol_length);
				status=per*100 + 100;
				volume=per*100 + 100;
				document.frkmx.settings.volume = volume;  //new volume
				document.frkmx.settings.mute = false;
				ImgSrc=eval("mutemode_off.src");
				document.mutemode.src=ImgSrc;
				document.mutemode.alt="소리끄기";
			}
			return false;
		}
	}

	function BGM_Duration() {
		setTrackIcon();
		if (document.frkmx.currentMedia.getItemInfo(frktle[track]).length>55)
		displaygasa.innerHTML = "";
		document.frkmx.closedCaption.captioningId = "displaygasa"
		songPlaying = document.frkmx.PlayState;
		if(songPlaying==10){checkloop();}
		if((songPlaying2==1)&&(songPlaying==1)){checkloop();}
		}


	function playerSetPosition() {
		if (positionSet==true) {
			positionSet=false;
			dragapproved=false;
			per=(trackPosition.style.pixelLeft-var_startpoint)/var_length;

			position=document.frkmx.currentMedia.duration*per;
			setPosition(position);
		}
	}

	var positionSet=false;
	function initTrackPosition() {
		positionSet=true;
		iex=event.clientX;
		iey=event.clientY;
		tempx=trackPosition.style.pixelLeft;
		tempy=trackPosition.style.pixelTop;
		dragapproved=true;
		document.onmousemove=positionDragControl;

		if (document.all)	{
			document.onmouseup=playerSetPosition;
		}
	}

	var var_length=trackbarlength; 
	var var_startpoint=trackbarposition;
	function positionDragControl() {
		if (dragapproved==true) {
			var mov = tempx+event.clientX-iex;
			if (mov >= var_startpoint  && mov <= var_startpoint+var_length) {
				document.all.trackPosition.style.pixelLeft=tempx+event.clientX-iex;
			}
			return false;
		}
	}

	function setPosition(position) {
		document.frkmx.controls.currentPosition=position;
	}

	function setTrackIcon() {
		if (positionSet!=true) {
			if (var_startpoint+(var_length*(document.frkmx.controls.currentPosition/document.frkmx.currentMedia.duration))) {
				document.all.trackPosition.style.pixelLeft=var_startpoint+(var_length*(document.frkmx.controls.currentPosition/document.frkmx.currentMedia.duration));
		 Frktotal=document.frkmx.currentMedia.durationString ;
		 var chktime = document.frkmx.controls.currentPositionString ;
		fulltime = chktime+ "/"+ Frktotal;
		playtime.innerHTML =  fulltime;
		if (document.frkmx.currentPlaylist.getItemInfo(track).length>55)
		displaygasa.innerHTML = "";
			document.frkmx.closedCaption.captioningId = "displaygasa"

			}
		}
	}


	function BGM_Play() {
		songPlaying = document.frkmx.PlayState;
		if(songPlaying == 2) {
		document.frkmx.Controls.Play();
		updateTrack(1);
		updateTitle(1);
		ImgSrc=eval("Pause_off.src");
		document.Pause.src=ImgSrc;
		document.Pause.alt="일시중지";
		ImgSrc=eval("play_on.src");
		document.play.src=ImgSrc;
		document.play.alt="재 생";
		ImgSrc=eval("stop_off.src");
		document.stop.src=ImgSrc;
		document.stop.alt="중 지";
		ImgSrc=eval("spectrum_on.src");
		document.spectrum.src=ImgSrc;
		ImgSrc=eval("spec_on.src");
		document.spec.src=ImgSrc;
		}
		else if(songPlaying == 3)
		{
		alert("이미 재생중입니다!!!");
		return true;
		}
		else{
		if (playmode == 1) {
		track = Math.floor(Math.random() * person.length);
		ImgSrc=eval("randommode_on.src");
		document.randommode.src=ImgSrc;
		document.randommode.alt="순차재생하기";
		ImgSrc=eval("Pause_off.src");
		document.Pause.src=ImgSrc;
		document.Pause.alt="일시중지";
		ImgSrc=eval("play_on.src");
		document.play.src=ImgSrc;
		document.play.alt="재생";
		ImgSrc=eval("stop_off.src");
		document.stop.src=ImgSrc;
		document.stop.alt="중 지";
		ImgSrc=eval("spectrum_on.src");
		document.spectrum.src=ImgSrc;
		ImgSrc=eval("spec_on.src");
		document.spec.src=ImgSrc;
		}
		else {
		ImgSrc=eval("randommode_off.src");
		document.randommode.src=ImgSrc;
		document.randommode.alt="랜덤재생하기";
		track = 0;}
		stopmode = 0;
		change(track);
		}
	}

	function change(aaa) {
		clearTimeout(songtime);
		songPlaying2=0;
		document.frkmx.Controls.Stop();
		track = aaa;
		if(track < 0 || track > (person.length - 1) ) {
		BGM_Stop();
		}
		else {
		stopmode = 0;
		var nowtrack1;
		if(smi[track]){nowtrack1 = person[track]+"?sami="+smi[track];}
		else {nowtrack1 = person[track];}
		document.frkmx.URL=nowtrack1;
		setInterval('BGM_Duration()',500);
		document.frkmx.Controls.Play();
		songPlaying2=1;
		updateTrack(1);
		updateTitle(1);
		ImgSrc=eval("play_on.src");
		document.play.src=ImgSrc;
		document.play.alt="재생";
		ImgSrc=eval("stop_off.src");
		document.stop.src=ImgSrc;
		document.stop.alt="중 지";
		ImgSrc=eval("spectrum_on.src");
		document.spectrum.src=ImgSrc;
		ImgSrc=eval("spec_on.src");
		document.spec.src=ImgSrc;
		if (allLoop == 1){
		ImgSrc=eval("allloop_on.src");
		document.allloop.src=ImgSrc;
		document.allloop.alt="한번씩 재생";
		}else{
		ImgSrc=eval("allloop_off.src");
		document.allloop.src=ImgSrc;
		document.allloop.alt="전체반복";
		}}
	}
	function BGM_Timeout(){
		songtime = setTimeout('t_time()', 5000);
	 }

	function t_time(){
		songPlaying = document.frkmx.PlayState;
		clearTimeout(songtime);
		if(stopmode == 0) {
		if (songPlaying == 2 || songPlaying == 1) {
		return true;
		}
		else {
		checkloop();
		updateTrack(1);
		updateTitle(1);
		}
		}
		else {updateTrack();
			  updateTitle();}
	}
	function checkloop() {
		if ( Looping == true ) { change(track);}
		else { BGM_Next();}

	}

	function  BGM_Allloop() {
		if (allLoop == false) {
		allLoop = true;
		ImgSrc=eval("allloop_on.src");
		document.allloop.src=ImgSrc;
		document.allloop.alt="한번씩 재생";
		}
		else if(allLoop = true){
		allLoop =  false;
		ImgSrc=eval("allloop_off.src");
		document.allloop.src=ImgSrc;
		document.allloop.alt="전체 반복";
		}
	}

	function  BGM_RandomPlay() {
		if (playmode == false) {
		playmode = true;
		ImgSrc=eval("randommode_on.src");
		document.randommode.src=ImgSrc;
		document.randommode.alt="순차재생하기";
		}
		else if (playmode == true) {
		playmode = false;
		ImgSrc=eval("randommode_off.src");
		document.randommode.src=ImgSrc;
		document.randommode.alt="랜덤재생하기";
		}
	}

	function BGM_Next() {
		if (playmode == 1) {
		var nextnum = Math.floor(Math.random() * person.length);
		ImgSrc=eval("Pause_off.src");
		document.Pause.src=ImgSrc;
		document.Pause.alt="일시중지";
		change(nextnum);
		ImgSrc=eval("randommode_on.src");
		document.randommode.src=ImgSrc;
		document.randommode.alt="순차재생하기";
		}
		else {
		if (allLoop == 1){
		if(track == (person.length - 1)) { var nextnum = 0; }
		else { var nextnum = track + 1; }
		ImgSrc=eval("Pause_off.src");
		document.Pause.src=ImgSrc;
		document.Pause.alt="일시중지";
		change(nextnum);
		}
		else {
		if(track == (person.length - 1)) {
		stopTitle = 0;
		ImgSrc=eval("Pause_off.src");
		document.Pause.src=ImgSrc;
		document.Pause.alt="일시중지";
		document.frkmx.Controls.Stop();
		songPlaying2=0;
		stopmode = 1;
		updateTrack();
		updateTitle();
		return true;}
		else { var nextnum = track + 1;
		change(nextnum);}
		}
		}
	}

	function BGM_Prev() {
		if (playmode == 1) {
		var prevnum = Math.floor(Math.random() * person.length);
		ImgSrc=eval("Pause_off.src");
		document.Pause.src=ImgSrc;
		document.Pause.alt="일시정지";
		change(prevnum);
		ImgSrc=eval("randommode_on.src");
		document.randommode.src=ImgSrc;
		document.randommode.alt="순차재생하기";
		}
		else{
		if (allLoop == 1){
		if(track == 0) { var prevnum = person.length - 1; }
		else { var prevnum = track - 1;  }
		ImgSrc=eval("Pause_off.src");
		document.Pause.src=ImgSrc;
		document.Pause.alt="일시정지";
		change(prevnum);
		}
		else {
		if(track == 0) {
		stopTitle = 2;
		ImgSrc=eval("Pause_off.src");
		document.Pause.src=ImgSrc;
		document.Pause.alt="일시정지";
		document.frkmx.Controls.Stop();
		songPlaying2=0;
		stopmode = 1;
		updateTrack();
		updateTitle();
		return true;}
		else { var prevnum = track - 1;
		change(prevnum);}
		}
		   }
	}

	function BGM_Pause(){
		songPlaying = document.frkmx.PlayState;
		if ((songPlaying == 0)||(songPlaying == 1)) { return false;}
		else if (songPlaying == 2) {
		playerstatus.innerHTML = "재생";
		document.frkmx.Controls.Play();
		ImgSrc=eval("Pause_off.src");
		document.Pause.src=ImgSrc;
		document.Pause.alt="일시중지";
		ImgSrc=eval("play_on.src");
		document.play.src=ImgSrc;
		document.play.alt="재생";
		ImgSrc=eval("spectrum_on.src");
		document.spectrum.src=ImgSrc;
		ImgSrc=eval("spec_on.src");
		document.spec.src=ImgSrc;
		}
		else if (songPlaying == 3) {document.frkmx.Controls.Pause();
		playerstatus.innerHTML = "일시중지";
		ImgSrc=eval("Pause_on.src");
		document.Pause.src=ImgSrc;
		document.Pause.alt="재생";
		ImgSrc=eval("play_off.src");
		document.play.src=ImgSrc;
		document.play.alt="재생";
		ImgSrc=eval("spectrum_off.src");
		document.spectrum.src=ImgSrc;
		ImgSrc=eval("spec_off.src");
		document.spec.src=ImgSrc;
		}
		else {return true;}
	}

	function BGM_Stop() {
		songPlaying = document.frkmx.PlayState;
		playtime.innerHTML = "00:00/00:00" ;
		if (songPlaying == 1) {
		alert("이미 정지되었습니다.");
		return true;}
		else {
		document.frkmx.Controls.Stop();
		songPlaying2=0;
		stopmode = 1;
		stopTitle = 1;
		updateTrack();
		updateTitle();
		return true;
		}
	}

	function BGM_Loop() {
		if(Looping == false)
		{
		Looping = true;
		ImgSrc=eval("loop_on.src");
		document.loop.src=ImgSrc;
		document.loop.alt="한번재생";
	  }
		else if(Looping = true) {
		Looping = false;
		ImgSrc=eval("loop_off.src");
		document.loop.src=ImgSrc;
		document.loop.alt="현재곡 반복";
	  }
	 }

	function BGM_Mute() {
		if(document.frkmx.settings.mute == false)
		{
		document.frkmx.settings.mute = true;
		ImgSrc=eval("mutemode_on.src");
		document.mutemode.src=ImgSrc;
		document.mutemode.alt="소리켜기";
	  }
		else if(document.frkmx.settings.mute == true) {
		document.frkmx.settings.mute = false;
		ImgSrc=eval("mutemode_off.src");
		document.mutemode.src=ImgSrc;
		document.mutemode.alt="소리끄기";
	  }
	 }

	function BGM_List( url, title,smifile,war) {
		if (person == null) { person = new Array(); count = 0;}
		else { count = person.length; }
		if (subj == null) { subj = new Array(); }
		person[count] = url;
		if (title == null || title == '' ) { title1 = ' Track [' + (count + 1) + '] '; }
		else { title1 = title; }
		subj[count] = title1;
		if(Titlecut!=0){subj[count] = subj[count].substring(0,Titlecut);}
		if (frktle == null) { frktle = new Array(); }
		frktle[count] = title;
		if (smi == null) { smi = new Array(); }
		smi[count] = smifile;
		if (frkric == null) { frkric = new Array(); }
		frkric[count] = war;
	}

	function updateTrack(f) { //이미지 업데이트
		if (f == 1) {
		ImgSrc=eval("Pause_off.src");
		document.Pause.src=ImgSrc;
		document.Pause.alt="일시중지";
		}
		else { //노래를 재생하고 있지 않다면...
		if ((stopTitle == 0)||(stopTitle == 2)) {
		ImgSrc=eval("Pause_off.src");
		document.Pause.src=ImgSrc;
		document.Pause.alt="일시중지";
		ImgSrc=eval("stop_on.src");
		document.stop.src=ImgSrc;
		document.stop.alt="중지됨";
		ImgSrc=eval("play_off.src");
		document.play.src=ImgSrc;
		document.play.alt="재생";
		ImgSrc=eval("spectrum_off.src");
		document.spectrum.src=ImgSrc;
		ImgSrc=eval("spec_off.src");
		document.spec.src=ImgSrc;
		playerstatus.innerHTML = "종료됨";
		return true;
		}
		else if (stopTitle == 1){
		ImgSrc=eval("Pause_off.src");
		document.Pause.src=ImgSrc;
		document.Pause.alt="일시중지";
		ImgSrc=eval("stop_on.src");
		document.stop.src=ImgSrc;
		document.stop.alt="중지됨";
		ImgSrc=eval("play_off.src");
		document.play.src=ImgSrc;
		document.play.alt="재생";
		ImgSrc=eval("spectrum_off.src");
		document.spectrum.src=ImgSrc;
		ImgSrc=eval("spec_off.src");
		document.spec.src=ImgSrc;
		return true;
		}
		}
	}

	function BGM_PList() {
		window.open("./list.php" , "MPList", " width="+bgmlistwidth+" height="+bgmlistheight+" toolbar=no location=no status=no directories=no scrollbars=no resizable=no copyhistory=no");
	}


// 제목 업데이트
function updateTitle(f) { //노래 제목 업데이트
	if (f == 1) {
	track_idx = track + 1;
	if((playTitle == 1) || (playTitle == 2)){
	stitle.innerHTML ="" + frktle[track]; //재생중인 곡명 메시지(수정가능)
	}else if(playTitle == 0){
	document.all.stitle.style.visibility = "hidden";
	}
	}
	else { //노래를 재생하고 있지 않다면...
	if((playTitle == 1) || (playTitle == 2)){
	if (stopTitle == 0) {
	stitle.innerHTML = " Player End. ";// 수정하지 말것
	return true;
	}
	else if (stopTitle == 1){
	stitle.innerHTML = "  Player Stopped";// 수정하지 말것
	return true;
	}
	else if (stopTitle == 2){
	stitle.innerHTML = " 처음곡 ▷ " + frktle[track];// 처음곡에서 이전곡 버튼 클릭시 메시지(수정가능)
	return true;
	}
	}else if(playTitle == 0){
	document.all.stitle.style.visibility = "hidden";
	document.all.stitle.style.width = 0;
	document.all.stitle.style.height = 0;
	}
	}
}

</script>

<script for="frkmx" EVENT="playStateChange(lOldState, lNewState)" LANGUAGE="JavaScript">
switch(document.frkmx.playState) {
        case 0:  // Undefined
		playerstatus.innerHTML = "연결중";
			break;
        case 1:  // Stopped
		playerstatus.innerHTML = "중지";
		document.all.item('trackPosition').style.left = trackbarposition;
		document.all.item('trackPosition').style.top = trackbartopposition;
			break;
        case 2:  // Paused
		playerstatus.innerHTML = "일시정지";
			break;
        case 3:  // Playing
		playerstatus.innerHTML = "재생중";
			break;
        case 4:  // ScanForward
		playerstatus.innerHTML = "뒤로";
			break;
        case 5:  // ScanReverse.
		playerstatus.innerHTML = "앞으로";
			break;
        case 6:  // Buffering.
		playerstatus.innerHTML = "버퍼링";
			break;
        case 7:  // Waiting
		playerstatus.innerHTML = "대기중";
			break;
        case 8:  // MediaEnded.
		playerstatus.innerHTML = "종료됨";
			break;
        case 9:  // Transitioning
		playerstatus.innerHTML = "연결중";
			break;
        case 10:  // Ready.
		playerstatus.innerHTML = "준비중";
		document.all.item('trackPosition').style.left = trackbarposition;
		document.all.item('trackPosition').style.top = trackbartopposition;
			break;
}
</script>
<script language=Javascript>
<?
	$checked_song=explode(",",$selected); 
	$checked_song=array_reverse($checked_song); 
	$array_cnt=count($checked_song); 
	for($i=0;$i<$array_cnt;$i++)
	{

	$temp=mysql_fetch_array(mysql_query("select wr_subject as subject, wr_name as name, wr_link1 as sitelink1, wr_link2 as sitelink2, wr_content as memo, wr_hit as hit from g4_write_$bo_table where wr_id='$checked_song[$i]'"));

	$subject[$i]=stripslashes($temp[subject]);
	if($temp1[file_name1]==true){ $arr = array($music_path,$temp1[file_name1]);}
	else{
	$arr = array($temp1[file_name1]);
	}

	$snd_path = implode("",$arr);
	$snd_1="";
	if(!eregi("\.smi",$temp[file_name1])) $snd_1="$temp[file_name1]";
	$snd_3="";
	if(!eregi("\.smi",$snd_path)) $snd_3="$snd_path";
	if ($snd_1==""){
		$song_path1[$i]=$snd_3;
	}else{
		$song_path1[$i]=$temp[file_name1];
	}
	$song_path3[$i]=$snd_path;

	if ($song_path1[$i]==true)
		{
?>
BGM_List("<?=$song_path1[$i]?>","<?=$subject[$i]?>","<?=$checked_song[$i]?>");
<?
}

//Hit Up
mysql_query("update zetyx_board"."_$id set hit=hit+1 where no='$no'");

}
mysql_close($connect); 
?>
var bo_table="<?=$bo_table?>";
</script>
<script language=javascript for=frkmx Event=EndOfStream(lResult)>
	checkloop();
</script>
<script language=javascript for=frkmx Event=Error>
        ErrorTitle();
        BGM_Timeout();
</script>

<script language="JavaScript">
<!-- JavaScript

function Player() { 
document.write("<img src=./images/Playerbg.gif>");
document.write("<div style='position:absolute;left:150px; top:8px;'>");
document.write("<img src=./images/spectrum_off.gif align=absmiddle name='spectrum' border=0 class=\"opacity1\" onmouseover=\"this.className='opacity2'\" onmouseout=\"this.className='opacity1'\">");
document.write("</div>");

document.write("<div style='position:absolute;left:300px; top:44px;'>");
document.write("<img src=./images/allloop_off.gif style='cursor:hand;' onclick='javascript:BGM_Allloop()' border=0 name=allloop align='absmiddle' alt='' class=\"opacity1\" onmouseover=\"this.className='opacity2'\" onmouseout=\"this.className='opacity1'\">");
document.write("</div>");

document.write("<div style='position:absolute;left:280px; top:44px;'>");
document.write("<img src=./images/random_off.gif style='cursor:hand;' onclick='javascript:BGM_RandomPlay()' border=0 name=randommode align='absmiddle' alt='' class=\"opacity1\" onmouseover=\"this.className='opacity2'\" onmouseout=\"this.className='opacity1'\">");
document.write("</div>");
/*
document.write("<div style='position:absolute;left:311px; top:38px;'>");
document.write("<img src=./images/Loop_off.gif onclick='javascript:BGM_Loop()' border=0 style='cursor:hand;' name=loop align='absmiddle' alt='현재곡 반복' class=\"opacity1\" onmouseover=\"this.className='opacity2'\" onmouseout=\"this.className='opacity1'\">");
document.write("</div>");
*/

document.write("<div style='position:absolute;left:30px; top:45px;'>");
if(playTitle == 0) {// 노래 제목이 나타날 부분
   document.write("<span id=stitle name='stitle' style='font-family:Tahoma;color:#000000;font-weight:bold;font-size:9pt;width:292px;'></span>");
}else if (playTitle == 1){
   document.write("<span id=stitle name='stitle' style='font-family:Tahoma;color:#000000;font-weight:bold;font-size:9pt;width:2932x;'></span>");
}else if(playTitle == 2){ // 제목을 스크롤 시킨다면.
   document.write("<marquee style='font-family:Tahoma;color:#FFCC00;font-weight:bold;font-size:9pt;width:292px;' lowspeed scrollamount=2><span id=stitle name='stitle'></span></marquee>");
}
document.write("</div>");
/*
document.write("<div style='position:absolute;left:250px; top:15px;'>");
   if(status == 0) { // 플래이어 상태표시 시작
   document.write("<span id='playerstatus' name='playerstatus' style='font-size:9pt;width:0;visibility:hidden;'></span>");
   }else if (status == 1){
   document.write("<span id='playerstatus' name='playerstatus' style='font-family:Tahoma;color:#000000;font-size:9pt;'></span>");
   }
document.write("</div>");
*/
document.write("<div style='position:absolute;left:17px; top:10px;'>");
   if(playruntime == 0) { // 진행시간표시시작
   document.write("<span id='playtime' name='playtime' style='font-size:12pt;width:0;visibility:hidden;'></span>");
   }else if (playruntime == 1){
   document.write("<span id='playtime' style='font-family:Tahoma;color:#AA294E;font-size:14pt;font-weight:bold;width:100px;'>00:00/00:00</span>");
   }
document.write("</div>");

document.write("<div style='position:absolute;left:324px; top:95px;'>");
document.write("<span id=words name=words></span>");
document.write("</div>");

document.write("<div style='position:absolute;left:156px; top:84px;'>");
if(PlayList == 0){ //리스트 버튼조절 시작
   document.write("<img src=./images/List_on.gif style='cursor:hand;' align='absmiddle' name=plist style='width:0px; height:0px;visibility:hidden;'>");
}else if(PlayList == 1){
   document.write("<img src=./images/List_on.gif style='cursor:hand;' onclick='javascript:BGM_PList(); return false;' border='0' align='absmiddle' name=plist alt='음악목록' class=\"opacity1\" onmouseover=\"this.className='opacity2'\" onmouseout=\"this.className='opacity1'\">");
}else if(PlayList == 2){ // 창 크기를 조절을 해야하는 버튼이라면..
   document.write("<a href=./list.php target=Player onfocus=this.blur()><img src=./images/List_on.gif onclick='javascript:setWindowSize("+bgmlistmaxw+","+bgmlistmaxh+")' border='0' align='absmiddle' name=plist alt='선택곡 목록보기' class=\"opacity1\" onmouseover=\"this.className='opacity2'\" onmouseout=\"this.className='opacity1'\"></a>");
}
document.write("</div>");

//콘트롤 버튼 시작
document.write("<div style='position:absolute;left:16px; top:84px;'>");
document.write("<img src=./images/Prev.gif onclick='javascript:BGM_Prev()' border=0 style='cursor:hand;' align=absmiddle alt='이전곡으로' class=\"opacity1\" onmouseover=\"this.className='opacity2'\" onmouseout=\"this.className='opacity1'\">");
document.write("</div>");

document.write("<div style='position:absolute;left:128px; top:84px;'>");
document.write("<img src=./images/Next.gif onclick='javascript:BGM_Next()' border=0 style='cursor:hand;' align='absmiddle' alt='다음곡으로' class=\"opacity1\" onmouseover=\"this.className='opacity2'\" onmouseout=\"this.className='opacity1'\">");
document.write("</div>");

document.write("<div style='position:absolute;left:100px; top:84px;'>");
document.write("<img src=./images/Stop_off.gif onclick='javascript:BGM_Stop()' style='cursor:hand;' border=0 align=absmiddle name='stop' alt='' class=\"opacity1\" onmouseover=\"this.className='opacity2'\" onmouseout=\"this.className='opacity1'\">");
document.write("</div>");

document.write("<div style='position:absolute;left:44px; top:84px;'>");
document.write("<img src=./images/Play_off.gif onclick='javascript:BGM_Play()' border=0 style='cursor:hand;' name='play' align=absmiddle alt='' class=\"opacity1\" onmouseover=\"this.className='opacity2'\" onmouseout=\"this.className='opacity1'\">");
document.write("</div>");

document.write("<div style='position:absolute;left:72px; top:84px;'>");
document.write("<img src=./images/Pause_off.gif onclick='javascript:BGM_Pause()' border=0 style='cursor:hand;' align=absmiddle name=Pause alt='' class=\"opacity1\" onmouseover=\"this.className='opacity2'\" onmouseout=\"this.className='opacity1'\">");
document.write("</div>");

document.write("<div style='position:absolute;left:240px; top:94px;'>");
document.write("<img src=./images/Mute_off.gif onclick='javascript:BGM_Mute()' border=0 style='cursor:hand;' name=mutemode align='absmiddle' alt='소리끄기' class=\"opacity1\" onmouseover=\"this.className='opacity2'\" onmouseout=\"this.className='opacity1'\">");
document.write("</div>");

document.write("<div style='position:absolute;left:5px; top:71px;'>");
if(trackControll == 1) { //트랙 진행볼 시작
	document.write("<img src=./images/Vol_back.gif name=volbar id=imgbar style='width:0px; height:0px;visibility:hidden;'>");
	document.write("<div ID='trackPosition' NAME='trackPosition' style='position:absolute; z-index:5; visibility:visible'>");
	document.write("<img src=./images/pnt_play.gif alt='트랙탐색' onmousedown=initTrackPosition() style='cursor:hand;' valign=absmiddle name=trackvol class=\"opacity1\" onmouseover=\"this.className='opacity2'\" onmouseout=\"this.className='opacity1'\">");
	document.write("</div>");
} else if (trackControll == 0) {
	document.write("<img src=./images/Vol_back.gif name=volbar id=imgbar style='width:0px; height:0px;visibility:hidden;'>");
	document.write("<div ID='trackPosition' NAME='trackPosition' style='width:0px; height:0px;visibility:hidden;'>");
	document.write("<img src=./images/pnt_play.gif name=trackvol id=trackvol style='width:0px; height:0px;visibility:hidden;'>");
	document.write("</div>"); //트랙 진행볼 끝
}
document.write("</div>");

document.write("<div style='position:absolute;left:282px; top:70px;'>");
if(BalanceControll == 1) { //볼륨벨런스 조절 시작
	document.write("<img src=./images/Vol_back.gif name=volbar id=imgbar style='width:0px; height:0px;visibility:hidden;'>");
	document.write("<div ID='balcontrol' NAME='balcontrol' style='position:absolute; z-index:2; visibility: visible'>");
	document.write("<img src=./images/bal_ball.gif onMousedown='initbalance();' onMouseup='Balanceout();' valign=absmiddle style='cursor:hand;' name=bal alt='볼륨 벨런스조절' class=\"opacity1\" onmouseover=\"this.className='opacity2'\" onmouseout=\"this.className='opacity1'\">");
	document.write("</div>");
} else if (BalanceControll == 0) {
	document.write("<img src=./images/Vol_back.gif name=volbar id=imgbar style='width:0px; height:0px;visibility:hidden;'>");
	document.write("<div ID='balcontrol' NAME='balcontrol' style='width:0px; height:0px;visibility:hidden;'>");
	document.write("<img src=./images/bal_ball.gif name=bal style='width:0px; height:0px;visibility:hidden;'>");
	document.write("</div>");
}//볼륨벨런스 조절끝
document.write("</div>");

document.write("<div style='position:absolute;left:253px; top:90px;'>");
if(VolumeControll == 1) { //볼륨조절 시작
	document.write("<img src=./images/Vol_back.gif name=volbar id=imgbar style='width:0px; height:0px;visibility:hidden;'>");
	document.write("<div ID='volcontrol' NAME='volcontrol' style='position:absolute; z-index:2; visibility: visible'>");
	document.write("<img src=./images/vol_ball.gif onMousedown='initializedragie()' onMouseup='Balanceout();' valign=absmiddle style='cursor:hand;' name=vol alt='볼륨조절' class=\"opacity1\" onmouseover=\"this.className='opacity2'\" onmouseout=\"this.className='opacity1'\">");
	document.write("</div>");
} else if (VolumeControll == 0) {
	document.write("<img src=./images/Vol_back.gif name=volbar id=imgbar style='width:0px; height:0px;visibility:hidden;'>");
	document.write("<div ID='volcontrol' NAME='volcontrol' style='width:0px; height:0px;visibility:hidden;'>");
	document.write("<img src=./images/vol_ball.gif name=vol style='width:0px; height:0px;visibility:hidden;'>");
	document.write("</div>");
}//볼륨조절 끝
document.write("</div>");

if(wordsplay == 0) { // 실시간 가사설정시작.
	document.write("<div id='displaygasa' name='displaygasa' style='position:absolute;left:0px; top:-1000px;z-index:4;visibility:hidden'></div>");
} else if (wordsplay == 1) {
	document.write("<div ID='displaygasa' NAME='displaygasa'  align=center STYLE='Position: absolute; Left:"+displayleft+"; Top:"+displaytop+"; width:270px; height:35px;'></div>");
} // 실시간 가사설정끝

document.write("<div style='position:absolute;left:0px; top:113px;'>");
document.write("<iframe src=./list.php STYLE='border-right: 0px; width:354px; height:500px;' scrolling=no name=Player frameborder=0 border=0></iframe>");
document.write("</div>");
}
// - JavaScript - -->
</script>

<script language=javascript>

function killerror(){
	return true;
}
function processKey()
{
        if( (event.ctrlKey == true && (event.keyCode == 78 || event.keyCode == 82)) ||
        (event.keyCode >= 112 && event.keyCode <= 123) || event.keyCode == 8)
            {
        event.keyCode = 0;
        event.cancelBubble = true;
        event.returnValue = false;
            }
}
window.onerror=killerror;
document.onkeydown = processKey;
var any = '';
var view_mode='close';
function re_size(){
	if(view_mode=='open'){
		oc0.style.display = 'block';
		view_mode = 'close';
	}
}
</script>
</head>
<body OnLoad="setting();" leftmargin=0 topmargin=0 oncontextmenu="return false" onselectstart="return false" ondragstart="return false" onkeydown="return false">
<form name="BGM">
<div style="Z-INDEX: 7; WIDTH: 115px;HEIGHT: 50px; POSITION: absolute; LEFT: -378px; TOP: -108px;">
<object classid='clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6' id=frkmx name=frkmx type='application/x-oleobject' standby='frk Windows Media Player...' width=0 height=0>
	<param name="ShowAudioControls" value="true">
	<param name="ShowPositionControls" value="true">
	<param name="ShowStatusBar" value="true">
	<param name="ShowTracker" value="true">
	<param name="ShowControls" value="true">
	<param name="loop" value="1">
	<param name="AudioStream" value="-1">
	<param name="AutoStart" value="true">
	<param name="AnimationAtStart" value="false">
	<param name="AllowScan" value="true">
	<param name="AllowChangeDisplaySize" value="true">
	<param name="AutoRewind" value="false">
	<param name="Balance" value="0">
	<param name="BufferingTime" value="4">
	<param name="ClickToPlay" value="true">
	<param name="CursorType" value="0">
	<param name="CurrentPosition" value="-1">
	<param name="CurrentMarker" value="0">
	<param name="DisplayBackColor" value="0">
	<param name="DisplayForeColor" value="16777215">
	<param name="DisplayMode" value="0">
	<param name="DisplaySize" value="true">
	<param name="Enabled" value="true">
	<param name="EnableContextMenu" value="false">
	<param name="EnablePositionControls" value="true">
	<param name="EnableFullScreenControls" value="false">
	<param name="EnableTracker" value="true">
	<param name="InvokeURLs" value="true">
	<param name="Language" value="-1">
	<param name="Mute" value="false">
	<param name="PlayCount" value="0">
	<param name="PreviewMode" value="false">
	<param name="Rate" value="1">
	<param name="SelectionStart" value="-1">
	<param name="SelectionEnd" value="-1">
	<param name="SendOpenStateChangeEvents" value="true">
	<param name="SendWarningEvents" value="true">
	<param name="SendErrorEvents" value="true">
	<param name="SendKeyboardEvents" value="false">
	<param name="SendMouseClickEvents" value="true">
	<param name="SendMouseMoveEvents" value="false">
	<param name="SendPlayStateChangeEvents" value="true">
	<param name="ShowCaptioning" value="false">
	<param name="ShowDisplay" value="false">
	<param name="ShowGotoBar" value="false">
	<param name="TransparentAtStart" value="false">
	<param name="VideoBorderWidth" value="0">
	<param name="VideoBorderColor" value="0">
	<param name="VideoBorder3D" value="false">
	<param name="WindowlessVideo" value="false">
	<param name="Volume" value="100">
</object>
</div>
<script language="JavaScript">
<!-- JavaScript
Player();
// - JavaScript - -->
</script>
</form>
</body>
</html>